﻿
@{
    Layout = null;
    var F = @Html.F();
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>登录</title>
    @F.RenderCss()

    <style>
        .loginlable {
            font-size:35px;
            font-weight:bold;
            line-height:40px;

            margin-top:20px;
            margin-left:10px;
        }

        .logintext input {
            border-width: 0px 0px 1px 0px;
            border-radius:0px;
            line-height:22px;
        }
        .logintext {
            font-size:18px;
        }
    </style>
</head>
<body>


    @{
        var pm = F.PageManager;

        // 主题
        var themeCookie = Context.Request.Cookies["Theme"];
        if (!String.IsNullOrEmpty(themeCookie))
        {
            string themeValue = themeCookie;

            Theme theme;
            if (Enum.TryParse<Theme>(themeValue, true, out theme))
            {
                pm.CustomTheme(String.Empty);
                pm.Theme(theme);
            }
            else
            {
                pm.CustomTheme(themeValue);
            }
        }
    }
    @F.PageManager

    @(
        F.Window()
        .ShowBorder(true)
        .ShowHeader(false)
        .EnableClose(false)
        .IsModal(false)//遮罩
        .Width(380)
        .Height(450)
        .Layout(LayoutType.VBox)
        .BoxConfigPosition(BoxLayoutPosition.Start)
        .BoxConfigAlign(BoxLayoutAlign.StretchMax)
        .WindowPosition(WindowPosition.Center)//居中
        .Items(
            F.Label()
            .BoxFlex(1),
            F.Label()
            .BoxFlex(1)
            .CssClass("loginlable")
            .Text("没想好的示例"),
            F.SimpleForm()
            .BoxFlex(4)
            .ShowBorder(false)
            .ShowHeader(false)
            .BodyPadding(10)
            .ID("SimpleForm1")
            .Items(
                F.TextBox()
                .ShowRedStar(true)
                .CssClass("logintext")
                .Required(true)//必填验证
                .EmptyText("请输入用户名")
                .ID("txtUsername"),
                F.TextBox()
                .ShowRedStar(true)
                .CssClass("logintext")
                .Required(true)
                .EmptyText("请输入密码")
                .ID("txtPassword")
                .TextMode(TextMode.Password),
                F.Panel()
                .BoxFlex(1)
                .ShowHeader(false)
                .ShowBorder(false)
                .Layout(LayoutType.VBox)
                .BoxConfigChildMargin("10px 0px 0px 0px")
                .Items(
                    F.Button()
                    .Type(ButtonType.Submit)
                    .ValidateForms("SimpleForm1")
                    .ValidateTarget(Target.Top)
                    .Text("登录")
                    .OnClick(Url.Action("btnLogin_Click"),"SimpleForm1"),
                    F.Button()
                    .Type(ButtonType.Reset)
                    .Text("重置")
                    )
                )
                )
        )

    @F.RenderScript()

</body>
</html>
